package com.sg.controller.pbff;

import com.sg.service.biz.pbff.CycleTypeService;
import com.sg.dto.biz.pbff.req.*;
import com.sg.dto.biz.pbff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "CycleType", tags = {"CycleType"})
@RestController
// @RequestMapping("/poms/cycleType/")
public class CycleTypeController {
    @Autowired
    CycleTypeService cycleTypeService;

    /**
     * B3-4新增周期类型（平台）
     * gen by moon at 8/26/2022, 2:42:18 PM
     */
    @PostMapping("/oms/platform/cycleType/addCycleType")
    @ApiOperation(value = "B3-4新增周期类型（平台）", response = OkrResult.class)
    public OkrResult<BffAddCycleTypeRespDto> addCycleType(@RequestBody(required = false) @Validated BffAddCycleTypeReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.addCycleType(reqDTO));
    }

    /**
     * B3-4查询周期详情(平台)
     * gen by moon at 11/29/2022, 8:06:52 PM
     */
    @PostMapping("/oms/platform/mgt/cycleType/queryCycleDetail")
    @ApiOperation(value = "B3-4查询周期详情(平台)", response = OkrResult.class)
    public OkrResult<BffQueryCycleDetailRespDto> queryCycleDetail(@RequestBody(required = false) @Validated BffQueryCycleDetailReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.queryCycleDetail(reqDTO));
    }

    /**
     * B3-4查询周期类型详情（平台）
     * gen by moon at 8/25/2022, 6:43:09 PM
     */
    @PostMapping("/oms/platform/cycleType/queryCycleTypeDetail")
    @ApiOperation(value = "B3-4查询周期类型详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryCycleTypeDetailRespDto> queryCycleTypeDetail(@RequestBody(required = false) @Validated BffQueryCycleTypeDetailReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.queryCycleTypeDetail(reqDTO));
    }

    /**
     * B3-4查询周期类型排序列表（平台）
     * gen by moon at 8/10/2022, 3:46:33 AM
     */
    @PostMapping("/oms/platform/cycleType/queryCycleTypeSortList")
    @ApiOperation(value = "B3-4查询周期类型排序列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryCycleTypeSortListRespDto> queryCycleTypeSortList(@RequestBody(required = false) @Validated BffQueryCycleTypeSortListReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.queryCycleTypeSortList(reqDTO));
    }

    /**
     * B3-4批量修改周期类型排序（平台）
     * gen by moon at 8/10/2022, 3:46:29 AM
     */
    @PostMapping("/oms/platform/cycleType/batchUpdateCycleTypeSort")
    @ApiOperation(value = "B3-4批量修改周期类型排序（平台）", response = OkrResult.class)
    public OkrResult<BffBatchUpdateCycleTypeSortRespDto> batchUpdateCycleTypeSort(@RequestBody(required = false) @Validated BffBatchUpdateCycleTypeSortReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.batchUpdateCycleTypeSort(reqDTO));
    }

    /**
     * B3-4查询周期列表（平台）
     * gen by moon at 12/6/2022, 1:40:19 AM
     */
    @PostMapping("/oms/platform/cycleType/queryCycleList")
    @ApiOperation(value = "B3-4查询周期列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryCycleListRespDto> queryCycleList(@RequestBody(required = false) @Validated BffQueryCycleListReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.queryCycleList(reqDTO));
    }

    /**
     * B3-4修改平台周期
     * gen by moon at 12/3/2022, 8:21:17 PM
     */
    @PostMapping("/oms/platform/cycleType/updateCycle")
    @ApiOperation(value = "B3-4修改平台周期", response = OkrResult.class)
    public OkrResult<BffUpdateCycleRespDto> updateCycle(@RequestBody(required = false) @Validated BffUpdateCycleReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.updateCycle(reqDTO));
    }

    /**
     * B3-4新增周期（平台）
     * gen by moon at 12/3/2022, 8:21:16 PM
     */
    @PostMapping("/oms/platform/cycleType/addCycle")
    @ApiOperation(value = "B3-4新增周期（平台）", response = OkrResult.class)
    public OkrResult<BffAddCycleRespDto> addCycle(@RequestBody(required = false) @Validated BffAddCycleReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.addCycle(reqDTO));
    }

    /**
     * B3-4查询可存档周期类型条件（平台）
     * gen by moon at 8/10/2022, 3:44:17 AM
     */
    @PostMapping("/oms/platform/cycleType/archiveCycleType")
    @ApiOperation(value = "B3-4查询可存档周期类型条件（平台）", response = OkrResult.class)
    public OkrResult<BffArchiveCycleTypeRespDto> archiveCycleType(@RequestBody(required = false) @Validated BffArchiveCycleTypeReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.archiveCycleType(reqDTO));
    }

    /**
     * B3-4查询关联的父周期类型关系列表（平台）
     * gen by moon at 11/27/2022, 9:22:17 PM
     */
    @PostMapping("/oms/platform/cycleType/queryCycleTypeInstanceRelationshipList")
    @ApiOperation(value = "B3-4查询关联的父周期类型关系列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryCycleTypeInstanceRelationshipListRespDto> queryCycleTypeInstanceRelationshipList(@RequestBody(required = false) @Validated BffQueryCycleTypeInstanceRelationshipListReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.queryCycleTypeInstanceRelationshipList(reqDTO));
    }

    /**
     * B3-4新增工作周期类型关系 (平台)
     * gen by moon at 11/27/2022, 9:22:16 PM
     */
    @PostMapping("/oms/platform/cycleType/addCycleTypeInstanceRelationship")
    @ApiOperation(value = "B3-4新增工作周期类型关系 (平台)", response = OkrResult.class)
    public OkrResult<BffAddCycleTypeInstanceRelationshipRespDto> addCycleTypeInstanceRelationship(@RequestBody(required = false) @Validated BffAddCycleTypeInstanceRelationshipReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.addCycleTypeInstanceRelationship(reqDTO));
    }

    /**
     * B3-4查询周期类型实例列表（平台）
     * gen by moon at 8/10/2022, 3:44:06 AM
     */
    @PostMapping("/oms/platform/cycleType/queryCycleTypeInstanceList")
    @ApiOperation(value = "B3-4查询周期类型实例列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryCycleTypeInstanceListRespDto> queryCycleTypeInstanceList(@RequestBody(required = false) @Validated BffQueryCycleTypeInstanceListReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.queryCycleTypeInstanceList(reqDTO));
    }

    /**
     * B3-4修改周期类型实例（平台）
     * gen by moon at 8/10/2022, 3:44:02 AM
     */
    @PostMapping("/oms/platform/cycleType/updateCycleTypeInstance")
    @ApiOperation(value = "B3-4修改周期类型实例（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateCycleTypeInstanceRespDto> updateCycleTypeInstance(@RequestBody(required = false) @Validated BffUpdateCycleTypeInstanceReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.updateCycleTypeInstance(reqDTO));
    }

    /**
     * B3-4新增周期类型实例（平台）
     * gen by moon at 8/10/2022, 3:43:58 AM
     */
    @PostMapping("/oms/platform/cycleType/addCycleTypeInstance")
    @ApiOperation(value = "B3-4新增周期类型实例（平台）", response = OkrResult.class)
    public OkrResult<BffAddCycleTypeInstanceRespDto> addCycleTypeInstance(@RequestBody(required = false) @Validated BffAddCycleTypeInstanceReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.addCycleTypeInstance(reqDTO));
    }

    /**
     * B3-4查询周期类型列表（平台）
     * gen by moon at 8/10/2022, 3:43:54 AM
     */
    @PostMapping("/oms/platform/cycleType/queryCycleTypeList")
    @ApiOperation(value = "B3-4查询周期类型列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryCycleTypeListRespDto> queryCycleTypeList(@RequestBody(required = false) @Validated BffQueryCycleTypeListReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.queryCycleTypeList(reqDTO));
    }

    /**
     * B3-4修改周期类型（平台）
     * gen by moon at 8/10/2022, 3:43:49 AM
     */
    @PostMapping("/oms/platform/cycleType/updateCycleType")
    @ApiOperation(value = "B3-4修改周期类型（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateCycleTypeRespDto> updateCycleType(@RequestBody(required = false) @Validated BffUpdateCycleTypeReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.updateCycleType(reqDTO));
    }

    /**
     * B3-4查询关联的子周期类型关系列表(管理)
     * gen by moon at 11/27/2022, 9:22:21 PM
     */
    @PostMapping("/oms/platform/mgt/cycleType/queryRelevancySubCycleTypeList")
    @ApiOperation(value = "B3-4查询关联的子周期类型关系列表(管理)", response = OkrResult.class)
    public OkrResult<BffQueryRelevancySubCycleTypeListRespDto> queryRelevancySubCycleTypeList(@RequestBody(required = false) @Validated BffQueryRelevancySubCycleTypeListReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.queryRelevancySubCycleTypeList(reqDTO));
    }

    /**
     * B3批量查询租户周期(管理)
     * gen by moon at 11/26/2022, 6:26:57 PM
     */
    @PostMapping("/oms/mgt/cycleType/batchQueryTenantCycle")
    @ApiOperation(value = "B3批量查询租户周期(管理)", response = OkrResult.class)
    public OkrResult<BffBatchQueryTenantCycleRespDto> batchQueryTenantCycle(@RequestBody(required = false) @Validated BffBatchQueryTenantCycleReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.batchQueryTenantCycle(reqDTO));
    }

    /**
     * B3查询租户周期类型列表ByCodes(管理)
     * gen by moon at 11/26/2022, 6:27:00 PM
     */
    @PostMapping("/oms/mgt/cycleType/batchQueryTenantCycleTypeListByCodes")
    @ApiOperation(value = "B3查询租户周期类型列表ByCodes(管理)", response = OkrResult.class)
    public OkrResult<BffBatchQueryTenantCycleTypeListByCodesRespDto> batchQueryTenantCycleTypeListByCodes(@RequestBody(required = false) @Validated BffBatchQueryTenantCycleTypeListByCodesReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.batchQueryTenantCycleTypeListByCodes(reqDTO));
    }

    /**
     * B3新增租户周期(管理)
     * gen by moon at 11/26/2022, 6:27:02 PM
     */
    @PostMapping("/oms/mgt/cycleType/addTenantCycle")
    @ApiOperation(value = "B3新增租户周期(管理)", response = OkrResult.class)
    public OkrResult<BffAddTenantCycleRespDto> addTenantCycle(@RequestBody(required = false) @Validated BffAddTenantCycleReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.addTenantCycle(reqDTO));
    }

    /**
     * B3修改租户周期(管理)
     * gen by moon at 11/26/2022, 6:27:03 PM
     */
    @PostMapping("/oms/mgt/cycleType/updateTenantCycle")
    @ApiOperation(value = "B3修改租户周期(管理)", response = OkrResult.class)
    public OkrResult<BffUpdateTenantCycleRespDto> updateTenantCycle(@RequestBody(required = false) @Validated BffUpdateTenantCycleReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.updateTenantCycle(reqDTO));
    }

    /**
     * B3删除平台周期(管理)
     * gen by moon at 12/3/2022, 8:21:22 PM
     */
    @PostMapping("/oms/platform/mgt/cycleType/deletePlatformCycle")
    @ApiOperation(value = "B3删除平台周期(管理)", response = OkrResult.class)
    public OkrResult<BffDeletePlatformCycleRespDto> deletePlatformCycle(@RequestBody(required = false) @Validated BffDeletePlatformCycleReqDto reqDTO) {
        return OkrResult.success(cycleTypeService.deletePlatformCycle(reqDTO));
    }

}

